package com.Threecharacters.Poly_.Polyparameter.Case2;

public class Test {
    public static void main(String[] args) {
        Employee[] employees = new Employee[5];

        employees[0] = new normalEmployee("张三", 10000);
        employees[1] = new normalEmployee("张四", 20000);
        employees[2] = new normalEmployee("张五", 30000);
        employees[3] = new Manager("张六", 40000,100000);
        employees[4] = new Manager("张七", 50000,100000);

        for (int i = 0; i < employees.length; i++) {
            
            if (employees[i] instanceof normalEmployee) {
                ((normalEmployee) employees[i]).work();
                System.out.println(employees[i].getAnnul());
            } else if (employees[i] instanceof Manager) {
                ((Manager) employees[i]).manage();
                System.out.println(employees[i].getAnnul());
            }


        }

    }
}
